package com.hnqcgczy.supplier.dao;

import com.hnqcgczy.supplier.vo.Admin;

import java.sql.SQLException;
import java.util.List;

/**
 * 说明：规则t_admin表的增删改查操作
 *
 * @author Emily
 */
public interface AdminDao {
    /**
     * 检查用户名是否可用
     *
     * @param userName
     * @return
     * @throws SQLException
     */
    boolean getUserByName(String userName) throws SQLException;

    /**
     * 注册（新增、添加）
     *
     * @param admin 管理员
     * @return
     * @throws SQLException
     */
    boolean reg(Admin admin) throws SQLException;

    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     * @throws SQLException
     */
    Admin login(String username, String password) throws SQLException;

    /**
     * 通过id修改信息
     *
     * @param admin
     * @return
     * @throws SQLException
     */
    boolean updateById(Admin admin) throws SQLException;

    /**
     * 通过id注销
     *
     * @param id
     * @return
     * @throws SQLException
     */
    boolean deleteById(Integer id) throws SQLException;


    /**
     * 查询用户
     *
     * @param admin
     * @return
     * @throws SQLException
     */
    List<Admin> queryAdmin(Admin admin) throws SQLException;

    /**
     * 查单个
     *
     * @param id
     * @return
     * @throws SQLException
     */
    Admin getAdminById(Integer id) throws SQLException;
}
